import React from 'react'
import { Image } from 'react-vant';
import result from './yjr_image/支付成功.png'
import './style/result.css'
import { Button } from 'react-vant'
import { useNavigate } from 'react-router-dom'

export default React.memo(function Result() {

    const navigator = useNavigate()

    const handleHref = () => {
        sessionStorage.setItem('integralShop', JSON.stringify({ flag: true }))
        navigator('/home/service')
    }

    const handleOrder = () => {
        navigator('/view')
    }

    return (
        <div className='header'>
            <div className='header__img'>
                <Image lazyload src={result} style={{ width: '70%', height: '70%', margin: 'auto' }} />
                <h1>支付成功</h1>
            </div>
            <div className='btn'>
                <Button round type='info' color='#f1f1f1' onClick={handleHref}>
                    <span style={{ color: 'red' }}>返回首页</span>
                </Button>
                <Button round type='info' color='red' onClick={handleOrder}>
                    查看订单
                </Button>
            </div>

        </div>

    )
})
